<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="Promise.js"></script>
</head>

<body>
    <script>
        let p1 = new Promise((resolve,reject)=>{
            setTimeout(()=>{
                resolve('111');
            },2000)
        })
        let p2 = new Promise((resolve,reject)=>{
            setTimeout(()=>{
                reject('2222');
            },1000)
        })
        let p3 = new Promise((resolve,reject)=>{
            setTimeout(()=>{
                resolve('2222');
            },1500)
        })
        let result = Promise.race([p1,p2,p3]);
        console.log(result);


    </script>

</body>

</html>